<?php
class ExampleController extends DefaultModuleController {
	
		public function actionIndex() {
		$action = getgpc('action','G');
		if($action=='area') {
			$provinceId = getgpc('provinceId','G');
			$areaArr = $this->db->fetch_all("SELECT * FROM god_category WHERE parentId='$provinceId' ORDER BY cateSort ASC");
			exit(json_encode($areaArr));
		}elseif($action=='schools') {
			$areaId = getgpc('areaId','G');
			$areaArr = $this->db->fetch_all("SELECT * FROM god_category WHERE parentId='$areaId' ORDER BY cateSort ASC");
			exit(json_encode($areaArr));
		}elseif($action=='network') {
			$networkId = getgpc('networkId','G');
			$areaArr = $this->db->fetch_all("SELECT * FROM god_category WHERE parentId='$networkId' ORDER BY cateSort ASC");
			exit(json_encode($areaArr));
		}
		
		$provinceArr = $this->db->fetch_all("SELECT * FROM god_category WHERE parentId='0' AND storeId = '1' ORDER BY cateSort ASC");
		
		$this->view->assign('provinceArr', $provinceArr);
		$this->view->display('example');
	}
	
	public function actionTest() {
		$this->message('只测试一下效果。');
	}
	
}